package excption.work;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class test1 {
    public static void main(String[] args) throws Exception {
        FileOutputStream fos =new FileOutputStream("fos.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter br =new BufferedWriter(osw);
        PrintWriter pw=new PrintWriter(br);
        Scanner s=new Scanner(System.in);
        System.out.println("请输入，单独输入exit时退出");
        while(true){
            String str=s.nextLine();
            if ("exit".equals(str)){
                break;
            }
            pw.println(str);

        }
        System.out.println("sh写出完毕");
        pw.close();
    }
}
